package com.todo1;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class CitiesServlet extends HttpServlet {

	private static final long serialVersionUID = 1707323726513587446L;
	
	@Override
	protected void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		CitiesController citiesController = new CitiesController();
		List<String> cities = citiesController.listCities();
		request.setAttribute("citiesList", cities);
		request.getRequestDispatcher("citiesList.jsp").forward(request, response);
	}
}
